package com.cy.boot.module.system.dal.mysql.temp;

import java.util.*;

import com.cy.boot.framework.common.pojo.PageResult;
import com.cy.boot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.cy.boot.framework.mybatis.core.mapper.BaseMapperX;
import com.cy.boot.module.system.dal.dataobject.temp.TempDO;
import org.apache.ibatis.annotations.Mapper;
import com.cy.boot.module.system.controller.admin.temp.vo.*;

/**
 * 测试用代码生成专用 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TempMapper extends BaseMapperX<TempDO> {

    default PageResult<TempDO> selectPage(TempPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TempDO>()
                .likeIfPresent(TempDO::getUsername, reqVO.getUsername())
                .eqIfPresent(TempDO::getPassword, reqVO.getPassword())
                .likeIfPresent(TempDO::getNickname, reqVO.getNickname())
                .eqIfPresent(TempDO::getRemark, reqVO.getRemark())
                .eqIfPresent(TempDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(TempDO::getPostIds, reqVO.getPostIds())
                .eqIfPresent(TempDO::getEmail, reqVO.getEmail())
                .eqIfPresent(TempDO::getMobile, reqVO.getMobile())
                .eqIfPresent(TempDO::getSex, reqVO.getSex())
                .eqIfPresent(TempDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(TempDO::getStatus, reqVO.getStatus())
                .eqIfPresent(TempDO::getLoginIp, reqVO.getLoginIp())
                .betweenIfPresent(TempDO::getLoginDate, reqVO.getLoginDate())
                .betweenIfPresent(TempDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TempDO::getId));
    }

}